#include "PassBallToTestCase.h"

/**
 * prekryta metoda samotneho testu
 */
bool PassBallToTestCase::Test()
{
	printf("\nPassBallToTestCase::Test()");

	GetPassBallToBehaviour()->Behave(Point(15, 0));

	if(world->ball->pos.GetX()>13 && world->ball->pos.GetX()<17 && world->ball->pos.GetY()>-2 && world->ball->pos.GetY()<2)
	{	
		DBGN_TEST("TEST PassBallToTestCase USPESNY ");
		fprintf(unitTestsLogFile, "ODCHYLKA: x:%f  y:%f \n",world->ball->pos.GetX()-15,world->ball->pos.GetY());
		SetIsTestSuccess(true);
		return true;
	}
	return false;
}


/**
 * prekryta metoda priprava na test
 */
bool PassBallToTestCase::PrepareBeforeTest()
{
	printf("\nPassBallToTestCase::PrepareBeforeTest()");
	
	Point ball = world->ball->pos;
	GetRunToPositionBehaviour()->Behave(ball, 2);

	if(world->me->pos.GetX()>ball.GetX()-0.5 && world->me->pos.GetX()<ball.GetX()+0.5 && world->me->pos.GetY()>ball.GetY()-0.5 && world->me->pos.GetY()<ball.GetY()+0.5)
	{
		DBGN_TEST("------------------------------------------------------\n");
		DBGN_TEST("TEST PassBallToTestCase PRIPRAVENY\n");
		return true;
	}
	return false;
}

/**
 * prekryta metoda, uprac po teste
 */
bool PassBallToTestCase::CleanUpTest()
{
	printf("\nPassBallToTestCase::CleanUpTest()");
	return true;
}

/**
 * prekryta metoda samotneho testu
 */
void PassBallToTestCase::OnTestPassed()
{
	printf("\nPassBallToTestCase::OnTestPassed()");
}